<?php

namespace App\Http\Controllers;

use App\Jobs\AppointList;
use App\Jobs\EduJob;
use App\Jobs\InterviewRemindJob;
use App\Jobs\TempPush;
use App\Models\Appoint;
use App\Models\Article;
use App\Models\InterviewRemind;
use App\Models\TempPushRecord;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class ArticleController extends Controller
{
    public function info(Request $request)
    {
        $id = $request->input('id');
        $article = Article::query()->where('id', $id)->first();
        if($article) {
            $info = $article->info()->select('title', 'content')->first();
            return new JsonResponse(['code'=>200,'msg'=>'成功','data'=>$info],200);
        }else{
            return new JsonResponse(['code'=>500,'msg'=>'文章不存在'],500);
        }

    }
}
